global _start
extern main
extern start_ctors
extern end_ctors
extern __cxa_finalize

[SECTION .text]
_start:
; init global object
start_ctors_loop:
	mov ebx, start_ctors
	jmp .test
.body:
	call [ebx]
	add ebx, 4
.test:
	cmp ebx, end_ctors
	jb .body

	call main

	call __cxa_finalize

	jmp $

